package com.huiyujiaoyu.powertime.ui.my;

import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.huiyujiaoyu.base.BaseActivity;
import com.huiyujiaoyu.powertime.R;
import com.huiyujiaoyu.powertime.model.UserInfoBean;
import com.huiyujiaoyu.util.ActivityUtil;
import com.huiyujiaoyu.widget.LlkjToolBar;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * Created by win7 on 2017/6/18.
 * 我的收藏
 */

public class MyAccountActivity extends BaseActivity {
    @BindView(R.id.toolbar)
    LlkjToolBar mToolbar;
    @BindView(R.id.tv_phone)
    TextView mTvPhone;
    @BindView(R.id.rl_genghuan)
    RelativeLayout mRlGenghuan;
    @BindView(R.id.tv_weixin)
    TextView mTvWeixin;
    @BindView(R.id.tv_qq)
    TextView mTvQq;
    @BindView(R.id.tv_weibo)
    TextView mTvWeibo;


    public static void launch(Context context) {
        ActivityUtil.startActivity(context, MyAccountActivity.class);
    }

    @Override
    protected void initView() {
        super.initView();
        setToolbar(mToolbar);
        mToolbar.setToolBar("账号", true, "", R.mipmap.icon_titlebar_back, false, "", LlkjToolBar.isNull);
        mTvPhone.setText(UserInfoBean.getInstance().getPhone());
        boolean qq = !TextUtils.isEmpty(UserInfoBean.getInstance().getQq());
        mTvQq.setText(qq?"已绑定":"尚未绑定");
        mTvQq.setSelected(qq);
        boolean wx = !TextUtils.isEmpty(UserInfoBean.getInstance().getWechat());
        mTvWeixin.setText(wx?"已绑定":"尚未绑定");
        mTvWeixin.setSelected(wx);
        boolean wb = !TextUtils.isEmpty(UserInfoBean.getInstance().getBlog());
        mTvWeibo.setText(wb?"已绑定":"尚未绑定");
        mTvWeibo.setSelected(wb);
    }

    @Override
    protected void initListener() {
        super.initListener();
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_account;
    }


    @OnClick({R.id.rl_genghuan, R.id.tv_weixin, R.id.tv_qq, R.id.tv_weibo})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.rl_genghuan:
                UpdataPhoneVerifActivity.launch(mContext);
                break;
            case R.id.tv_weixin:
                break;
            case R.id.tv_qq:
                break;
            case R.id.tv_weibo:
                break;
        }
    }
}
